<?php

class Api
{
    public static function init()
    {
        $path = dirname(__FILE__) . '/';

        Yii::$classMap = array_merge(
            Yii::$classMap,
            array(
                /* db */
                'DbConnection' => $path . 'db/DbConnection.php',
                'DbCommand' => $path . 'db/DbCommand.php',
                'DbDataReader' => $path . 'db/DbDataReader.php',
                'DbTransaction' => $path . 'db/DbTransaction.php',

                'CDbConnectionMan' => $path . 'db/connect_man/CDbConnectionMan.php',
                'DbConnectionMan' => $path . 'db/connect_man/DbConnectionMan.php',

                /* models */
                'BaseDBModel' => $path . 'models/base/BaseDBModel.php',

                /* components */
                'WebUser' => $path . 'components/WebUser.php',
                //'ActionAndLangOutputCache' => $path . 'components/ActionAndLangOutputCache.php',
                //'ControllerActionUserIdOutputCache' => $path . 'components/ControllerActionUserIdOutputCache.php',
                //'NewsOutputCache' => $path . 'components/NewsOutputCache.php',
                'CustomHttpRequest' => $path . 'components/CustomHttpRequest.php',

                /* controllers */
                'BaseController' => $path . 'controllers/BaseController.php',
            )
        );

        require $path . 'components/AutoloadDbConfig.php';
        AutoloadDBConfig::init();
    }
}
